<?php
namespace app\admin\api;


use think\Controller;
use \think\Session;
use app\admin\common\Http\ConferenceHttpClient;


//登录接口类
class login extends ConferenceHttpClient
{

    /**
     * 登录
     * @return [type] [description]
     */
    public function index($data)
    {
            if($data) {
                //获取数据
                $url = '/client/login';
                $res = $data;

                //请求接口信息
                $result = $this->post($url,$res);

                //用户信息存入session
                if ($result->code == 0){
                    Session::set('user',$result->data->item) ;
                    return 0;

                }else{
                    return 1;
                }
            }
    }
}